{extend name="$BASE_POPUP_FORM" /}
{block name="body"}
<style>
    .edui-editor, .edui-editor-iframeholder {
        width: 530px !important;
    }
</style>
<div class="box-content">   
    <input type="hidden" id="id" name="id" value="{$id}"/>
    <div class="control-row col-2">
        <div class="control-group">
            <label class="control-label">
                视频标题</label>
            <div class="controls">
                <input type="text" id="video_title" name="video_title" class="form-control required" />
            </div>
        </div> 
        <div class="control-group">
            <label class="control-label">是否发布</label>
            <div class="controls">
                <select name="is_public" id="is_public" class="form-control">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">
            视频封面
        </label>
        <div class="controls">
            <div id="js_upload_wrp">
                <input type="hidden" id="video_img" name="video_img" value="" class="" />
                {:hook('picResource',array('name'=>'video_img','folder'=>'video_cover','tips'=>'建议尺寸：750x240像素。仅支持.jpg .png格式长方形照片。','callback'=>'uploadImgCallback'))}
            </div>
        </div>
    </div>
    
    <div class="control-group video_url_div" style="">
        <label class="control-label">
            视频
        </label>
        <div class="controls">
            <div id="">
                <input type="hidden" id="video_path" name="video_path" value="" class="" />
                {:hook('videoResource',array('name'=>'video_path','folder'=>'video_cover','tips'=>'建议上传正确的视频。','callback'=>'uploadVideoCallback'))}
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    function onLoadDataSuccess(data){
        console.log(data)
        // onLoadSuccess(data);
        setPicValue("video_img", data['video_img']);
        setVideoValue('video_path',data['video_path'])

    }
    function uploadImgCallback(path) {
        $("#video_img").val(path);
    }
    function uploadVideoCallback(path) {
        $("#video_path").val(path);
    }
</script>
{/block}
